Repository navigation
feat(idp-provider): multi-key signing set + Slice 5 rollover key (serial 1004) - #13786
Merged
Merged
Conversation
Slice 5 of #13658 (key rollover with overlapping JWKS), code half: - TokenSigner becomes a key set keyed by kid: new tokens are signed with the configured active key; verification accepts any key in the set, selected by the token header's kid. from_keys fails closed on an empty set, duplicate kids, or an active kid outside the set. - Provider config gains IDP_PROVIDER_OIDC_CERTS / IDP_PROVIDER_OIDC_KEYS (comma-separated parallel lists) and IDP_PROVIDER_OIDC_ACTIVE_KID. The JWKS is built from every listed certificate; startup proves every loaded key matches the certificate at its position, as before, now per key. - The rollover successor key is issued and published: pkgs/idp-pki/trust/oidc-signing-2.crt.pem — serial 1004 from the IdP issuing CA (oidc-signing profile, RSA 2048, 1095 days), SHA-256 fingerprint 59:EF:0E:3D:...:59:7A; its encrypted private key is escrowed in the vault as idp.oidc-signing-2.key and held on-host under ~/idp-ca/issued/oidc-signing-2/. Hygiene note: serial 1003 was issued first and revoked unused (CRL regenerated) after a bws CLI error echoed a prefix of its encrypted key into a session log — the same failure the Slice 2 record describes. Root cause found this time: a PEM value starts with '-' characters, so bws's argument parser eats it as an option unless the value follows '--'. The working escrow form (bws secret create -- KEY VALUE PROJECT, argv-direct) is recorded in pkgs/idp-pki/README.md. - Tests: 4 new rollover tests — overlap verification across kids, retirement rejection on kid, bad-set rejection, and /userinfo accepting a pre-rollover token during the overlap but not after retirement. 19/19 crate tests pass on the laptop. The live rollover of the running provider (overlap -> active flip -> retirement) is executed and recorded on #13658 from this build.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 12 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #13658 (Slice 5 — key rollover with overlapping JWKS; the story stays open for the remaining slices).
What lands
Multi-key signer (
src/signing.rs):TokenSignernow holds a set of keys keyed bykid.sign_jwtuses the configured active key;verify_jwtselects by the token header'skidand rejects unknown kids.from_keysfails closed on an empty set, duplicate kids, or an active kid outside the set. The single-keynew()keeps its exact prior behaviour (existing tests unchanged in shape).Config (
src/lib.rs):IDP_PROVIDER_OIDC_CERTS/IDP_PROVIDER_OIDC_KEYS(comma-separated, parallel) andIDP_PROVIDER_OIDC_ACTIVE_KID. The JWKS is built from every listed certificate (jwks_from_cert_pems); startup requires key count == cert count and proves each loaded key matches the certificate at its position before serving — the Slice 3 fail-closed check, generalized. Single-cert/single-key configurations (today's live provider) work unchanged.The rollover key itself:
pkgs/idp-pki/trust/oidc-signing-2.crt.pem— serial 1004, CN "Developing Today IdP OIDC Signing 2", issued from the IdP issuing CA with theoidc-signingprofile (RSA 2048, 1095 days, chain verified), SHA-256 fingerprint59:EF:0E:3D:7E:61:91:D4:97:D2:AB:58:54:41:A5:71:B8:41:25:BB:27:E7:3A:A4:C5:1C:CD:84:34:C9:59:7A. Its passphrase-encrypted private key is on-host at~/idp-ca/issued/oidc-signing-2/(0600) and escrowed in the vault asidp.oidc-signing-2.key.Evidence
Laptop, in the worktree: 19/19 crate tests pass — the 15 from the doors landing plus 4 new rollover tests (
tests/rollover.rs): overlap signer verifies both kids and signs with the active one; a retired key's tokens are rejected onkid; bad key sets are rejected; and at the flow level/userinfoaccepts a pre-rollover access token during the overlap and returns 401 for it after retirement.Follow-through
The live rollover of the running laptop provider — overlap with old active → active flips to serial 1004 → old key retired after the (300 s TTL) window — is executed from this build and recorded on #13658 with per-phase evidence.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.